import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { BaseService } from 'src/modules/base.service';
import { Repository } from 'typeorm';
import { CreateMenuDto, UpdateMenuDto } from './menu.dto';
import { Menu } from './menu.entity';
@Injectable()
export class MenuService extends BaseService {
  module: Repository<Menu>;
  constructor(
    @InjectRepository(Menu)
    private menusRepository: Repository<Menu>,
  ) {
    super();
    this.module = this.menusRepository;
  }

  async create(data: CreateMenuDto): Promise<any> {
    return await this.menusRepository.save(data);
  }

  async update(data: UpdateMenuDto): Promise<any> {
    return this.menusRepository.save(data);
  }
}
